<?php

    /*
    ** RSS Example
    */

    include('./class/inc.rss.php');
    include './class/class.database.php'; 
    include 'config.php';
    include 'functions.php'; 
	$db = new database($server, $username, $password, $database);
  $db->connect(database);
    // RSS items list:
    $example_list = array();    
    $result=mysql_query("SELECT * FROM posts WHERE post_approve = 0 ORDER BY post_date DESC LIMIT 0,10");
    /*
    ** Create some test entries:
    */
	while ($list = mysql_fetch_assoc($result))
	{
	$page=$list['post_page']; if ($list['post_page']==0){$page=1;}
	$post = "topic.php?t=".$list['post_topic']."&amp;page=".$page."#".$list['post_id'];
	$content = substr($list[post_content],0,470);
	$content = str_replace('%69%66%72%61%6D%65', 'iframe', $content);
    $example_list[] = array(
        'title' => "$list[post_subject]",
        'url' => $forum_url."/".$post,
        'desc' => strip_tags($content)." ...<hr>",
        'date' => mktime(date('H',strtotime($list['post_date'])), date('i',strtotime($list['post_date'])), 0, date('m',strtotime($list['post_date'])), date('d',strtotime($list['post_date'])), date('Y',strtotime($list['post_date']))) // Dez. 17, 2006
    );
    }
       
    // create new RSS object:
    $rss = new rss74();
    
    /*
    ** Set RSS informations:
    */
    
    // RSS title:
    $rss->title = $l_forumname;
    
    // RSS description:
    $rss->desc = $l_forumdesc;
    
    // base URL of your homepage:
    $rss->base_url = $forum_url;
    
    // limit entry count to 10
    $rss->limit_entries = 10;
    
    // Set Feedburner adress:
    //$rss->feedburner_url = 'http://feeds.feedburner.com/codedump-rss';
    // (empty) = No redirection

    // Set "xsl_file" to empty to disable the XSL file
    //$rss->xsl_file = '';

    // Add entries to the RSS object:
    while (list($date, $entry) = each($example_list)){
               
        $rss->add_entry(array(
            'title'     => $entry['title'],
            'url'       => $entry['url'],
            'desc'      => $entry['desc'],
            'date'      => $entry['date']
        ));
    
    }
    
    // let rss74 do the rest:
    $rss->print_rss();

?>